package com.xcity.game.combat.attr;

import java.text.MessageFormat;

public interface CombatAttributeFormatter {

	Object format(float value);
	
	enum Formatters implements CombatAttributeFormatter {
	
		PLAIN {
			@Override
			public Object format(float value) {
				return Integer.valueOf((int) value);
			}
		},
		
		PERCENT {
			@Override
			public Object format(float value) {
				return MessageFormat.format("{0,number,#.##}%", value * 100);
			}
		},
		
		/** 千倍值转为百分比显示 */
		THOUSANDFOLD_PERCENT {
			@Override
			public Object format(float value) {
//				return MessageFormat.format("{0,number,#.##}%", value / 1000 * 100);
				return MessageFormat.format("{0,number,#.##}%", value / 10);
			}
		}
		;
		
	}
	
}
